<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- Object.cpp -->
  <meta name="description" content="仪器通讯基础库.">
  <title>Object Class | OpenVisa 0.15.0</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li><a href="index.html">OpenVisa 0.15.0</a></li>
<li><a href="openvisa-module.html" translate="no">OpenVisa</a></li>
<li>Object</li>
<li id="buildversion">OpenVisa 0.15.0 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3 id="toc">Contents</h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title" translate="no">Object Class</h1>
<span class="small-subtitle" translate="no">class <a href="openvisa-module.html" translate="no">OpenVisa</a>::Object</span>
<!-- $$$Object-brief -->
<p>仪器通讯基础库. <a href="#details">More...</a></p>
<!-- @@@Object -->
<div class="table"><table class="alignedsummary requisites" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <code translate="no">#include &lt;Object.h&gt;</code></td></tr>
</table></div>
<ul>
<li><a href="openvisa-object-members.html">List of all members, including inherited members</a></li>
</ul>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html" translate="no">Attribute</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-commoncommand.html" translate="no">CommonCommand</a></b></td></tr>
</table></div>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#Object" translate="no">Object</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#dtor.Object" translate="no">~Object</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::Object::Attribute &amp;</td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#attribute" translate="no">attribute</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#close" translate="no">close</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::Object::CommonCommand &amp;</td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#commonCommand" translate="no">commonCommand</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#connected" translate="no">connected</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::string </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#query" translate="no">query</a></b>(const std::string &amp;<i>fmt</i>, const Args &amp;... <i>args</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::tuple&lt;std::string, bool&gt; </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#read" translate="no">read</a></b>(unsigned long <i>blockSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::string </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#readAll" translate="no">readAll</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::string </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#removeTermChars" translate="no">removeTermChars</a></b>(const std::string &amp;<i>source</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#send" translate="no">send</a></b>(const std::string &amp;<i>fmt</i>, const Args &amp;... <i>args</i>)</td></tr>
</table></div>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::AddressVariant </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#fromVisaAddressString" translate="no">fromVisaAddressString</a></b>(const std::string &amp;<i>str</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::vector&lt;std::string&gt; </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#listSerialPorts" translate="no">listSerialPorts</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::vector&lt;OpenVisa::Address&lt;AddressType::USB&gt;&gt; </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#listUSB" translate="no">listUSB</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> std::string </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object.html#toVisaAddressString" translate="no">toVisaAddressString</a></b>(const T &amp;<i>addr</i>)</td></tr>
</table></div>
<!-- $$$Object-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@Object -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Object[overload1]$$$Object -->
<h3 class="fn" translate="no" id="Object">Object::<span class="name">Object</span>()</h3>
<p>构造函数.</p>
<!-- @@@Object -->
<!-- $$$~Object[overload1]$$$~Object -->
<h3 class="fn" translate="no" id="dtor.Object"><code class="details extra" translate="no">[virtual noexcept]</code> Object::<span class="name">~Object</span>()</h3>
<p>析构函数.</p>
<!-- @@@~Object -->
<!-- $$$attribute[overload1]$$$attribute -->
<h3 class="fn" translate="no" id="attribute"><code class="details extra" translate="no">[noexcept]</code> <span class="type"><a href="openvisa-object-attribute.html" translate="no">OpenVisa::Object::Attribute</a></span> &amp;Object::<span class="name">attribute</span>()</h3>
<p>返回属性设置.</p>
<!-- @@@attribute -->
<!-- $$$close[overload1]$$$close -->
<h3 class="fn" translate="no" id="close"><code class="details extra" translate="no">[noexcept]</code> <span class="type">void</span> Object::<span class="name">close</span>()</h3>
<p>关闭仪器连接.</p>
<!-- @@@close -->
<!-- $$$commonCommand[overload1]$$$commonCommand -->
<h3 class="fn" translate="no" id="commonCommand"><code class="details extra" translate="no">[noexcept]</code> <span class="type"><a href="openvisa-object-commoncommand.html" translate="no">OpenVisa::Object::CommonCommand</a></span> &amp;Object::<span class="name">commonCommand</span>()</h3>
<p>IEEE488.2公共指令接口.</p>
<!-- @@@commonCommand -->
<!-- $$$connected[overload1]$$$connected -->
<h3 class="fn" translate="no" id="connected"><code class="details extra" translate="no">[noexcept]</code> <span class="type">bool</span> Object::<span class="name">connected</span>() const</h3>
<p>返回仪器是否已连接.</p>
<!-- @@@connected -->
<!-- $$$fromVisaAddressString[overload1]$$$fromVisaAddressStringconststd::string& -->
<h3 class="fn" translate="no" id="fromVisaAddressString"><code class="details extra" translate="no">[static]</code> <span class="type">OpenVisa::AddressVariant</span> Object::<span class="name">fromVisaAddressString</span>(const <span class="type">std::string</span> &amp;<i>str</i>)</h3>
<p>从Visa连接描述字符串 <i translate="no">str</i> 转换为地址类型联合体.</p>
<p><b>See also </b><a href="openvisa-object.html#toVisaAddressString" translate="no">toVisaAddressString</a>.</p>
<!-- @@@fromVisaAddressString -->
<!-- $$$listSerialPorts[overload1]$$$listSerialPorts -->
<h3 class="fn" translate="no" id="listSerialPorts"><code class="details extra" translate="no">[static]</code> <span class="type">std::vector</span>&lt;<span class="type">std::string</span>&gt; Object::<span class="name">listSerialPorts</span>()</h3>
<p>列出所有串口名称.</p>
<!-- @@@listSerialPorts -->
<!-- $$$listUSB[overload1]$$$listUSB -->
<h3 class="fn" translate="no" id="listUSB"><code class="details extra" translate="no">[static]</code> <span class="type">std::vector</span>&lt;<span class="type"><a href="openvisa-address.html" translate="no">OpenVisa::Address</a></span>&lt;<span class="type">AddressType::USB</span>&gt;&gt; Object::<span class="name">listUSB</span>()</h3>
<p>列出所有USBTMC驱动设备.</p>
<!-- @@@listUSB -->
<!-- $$$query[overload1]$$$queryconststd::string&constArgs&... -->
<h3 class="fn" translate="no" id="query">template &lt;typename... Args&gt; <span class="type">std::string</span> Object::<span class="name">query</span>(const <span class="type">std::string</span> &amp;<i>fmt</i>, const <span class="type">Args</span> &amp;... <i>args</i>)</h3>
<p>格式化发送查询scpi指令，参考 std::format 格式化设置, <i translate="no">fmt</i>, <i translate="no">args</i>, 并返回查询值.</p>
<p><b>See also </b><a href="openvisa-object.html#send" translate="no">send</a> and <a href="openvisa-object.html#readAll" translate="no">readAll</a>.</p>
<!-- @@@query -->
<!-- $$$read[overload1]$$$readunsignedlong -->
<h3 class="fn" translate="no" id="read"><span class="type">std::tuple</span>&lt;<span class="type">std::string</span>, <span class="type">bool</span>&gt; Object::<span class="name">read</span>(<span class="type">unsigned</span> <span class="type">long</span> <i>blockSize</i>)</h3>
<p>读取 <i translate="no">blockSize</i> 大小的数据，返回读到的数据，当没有更多的数据可读时，布尔值为false.</p>
<p><b>See also </b><a href="openvisa-object.html#readAll" translate="no">readAll</a>.</p>
<!-- @@@read -->
<!-- $$$readAll[overload1]$$$readAll -->
<h3 class="fn" translate="no" id="readAll"><span class="type">std::string</span> Object::<span class="name">readAll</span>()</h3>
<p>读取所有数据.</p>
<p><b>See also </b><a href="openvisa-object.html#read" translate="no">read</a>.</p>
<!-- @@@readAll -->
<!-- $$$removeTermChars[overload1]$$$removeTermCharsconststd::string& -->
<h3 class="fn" translate="no" id="removeTermChars"><span class="type">std::string</span> Object::<span class="name">removeTermChars</span>(const <span class="type">std::string</span> &amp;<i>source</i>) const</h3>
<p>移除字符串 <i translate="no">source</i> 尾部的终结符.</p>
<div class="admonition note">
<p><b>Note: </b>若未启用终结符，则该函数不做任何处理.</p>
</div>
<p><b>See also </b><a href="openvisa-object.html#query" translate="no">query</a> and <a href="openvisa-object.html#readAll" translate="no">readAll</a>.</p>
<!-- @@@removeTermChars -->
<!-- $$$send[overload1]$$$sendconststd::string&constArgs&... -->
<h3 class="fn" translate="no" id="send">template &lt;typename... Args&gt; <span class="type">void</span> Object::<span class="name">send</span>(const <span class="type">std::string</span> &amp;<i>fmt</i>, const <span class="type">Args</span> &amp;... <i>args</i>)</h3>
<p>格式化发送scpi指令，参考 std::format 格式化设置, <i translate="no">fmt</i>, <i translate="no">args</i>.</p>
<p><b>See also </b><a href="openvisa-object.html#readAll" translate="no">readAll</a> and <a href="openvisa-object.html#read" translate="no">read</a>.</p>
<!-- @@@send -->
<!-- $$$toVisaAddressString[overload1]$$$toVisaAddressStringconstT& -->
<h3 class="fn" translate="no" id="toVisaAddressString"><code class="details extra" translate="no">[static]</code> template &lt;typename T&gt; <span class="type">std::string</span> Object::<span class="name">toVisaAddressString</span>(const <span class="type">T</span> &amp;<i>addr</i>)</h3>
<p>将地址类型 <i translate="no">addr</i> 转换为 Visa 连接描述字符串.</p>
<p><b>See also </b><a href="openvisa-object.html#fromVisaAddressString" translate="no">fromVisaAddressString</a>.</p>
<!-- @@@toVisaAddressString -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> OpenVisa
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/> </div>
</body>
</html>
